package com.cgly.medical.domain;

import com.cgly.medical.domain.superdomain.SuperDomain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @program: medical
 * @description: 用户实体类
 * @author: chen di
 * @create: 2022-08-15 15:00
 */
/*
Data 注解生成的 toString 方法也只包含了子类自有属性。
解决方案一样，加上 @ToString(callSuper = true) 注解，其实这里真正重要的是注解中的属性，callSuper = true，
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Account extends SuperDomain implements Serializable {
    private Long id;
    private String realname;//真实姓名
    private String uname;
    private String pwd;
    private String phonenumber;//注意数据库不是驼峰
    private String utype;
    private Date updatetime;
    private Date createtime;
    private String email;
    private String salt;//加密盐


    public Account(Long id, String realname, String uname, String pwd, String phonenumber, String utype, String email, String salt) {
        this.id = id;
        this.realname = realname;
        this.uname = uname;
        this.pwd = pwd;
        this.phonenumber = phonenumber;
        this.utype = utype;
        this.email = email;
        this.salt = salt;
    }
}